import StrTo from "../../src/utils/StrTo";
import Module from "../../src/str/Module";
import Domain from "../../src/str/Domain";
import Intra from "../../src/page/Intra";
import Unit from "../../src/str/Unit";
const fs = require('fs');





let res=StrTo.utf8ToNum("成成成成成成成成ssd范德萨范德萨");

console.log(res)
console.log(StrTo.numToUtf8(res))

res=res+"a"+res


let unit = new Unit(res,res,res,res);

let module = new Module();
module.addUnit(unit)
module.addUnit(unit)
module.addUnit(unit)
module.addUnit(unit)
module.addUnit(unit)

let domain = new Domain();

domain.addModule(module)
domain.addModule(module)

let outData = domain.outData();


let buff =Intra.intrasToBuff(outData)


fs.writeFile("D:\\work\\rdguan\\dguan\\node_switch\\test\\StrToTest\\xxxx", buff, (err) => {
    if (err) {
        console.error(err);
        return;
    }
    console.log("File saved successfully!");
});
console.log("File saved successfully!");


let domain1 = new Domain();

let buffToIntras = Intra.buffToIntras(buff);

domain1.loadData(buffToIntras);

console.log(domain1)






